<template>
  <div class="wrapper">
    <Anchor :labelList="labels" activeId="row-01" labelWidth="100">
      <div class="line" id="row-01">
        <InfoBase v-model="value" />
      </div>
      <div class="line" id="row-02">
        <infoActivity v-model="value" />
      </div>
      <div class="line" id="row-03">
        <infoGoods v-model="value" />
      </div>
      <div class="line" id="row-04">
        <infoDealer v-model="value" />
      </div>
    </Anchor>
    <div class="dialogBottmView">
      <el-button @click="closeDialog">关 闭</el-button>
      <el-button @click="saveDialog" v-if="value.type!=='show'" type="primary">分 配</el-button>
      <el-button @click="saveDialog" v-if="value.type==='edit' || value.type==='show'" type="primary">作 废</el-button>
      <el-button @click="saveDialog" v-if="value.type!=='show'"  type="primary">保 存</el-button>
    </div>
  </div>
</template>

<script>
import { authority } from '@/utils/authMixin';
import { dictionary } from '@/utils/dictMixin';
import InfoBase from './infoBase'; //基本信息
import infoActivity from '../commonForm/infoActivity'; //活动列表
import infoGoods from '../commonForm/infoGoods'; //物料列表
import infoDealer from '../commonForm/dealer'; //事业部列表


export default {
  mixins: [authority, dictionary],
  components: {
    InfoBase,
    infoActivity,
    infoGoods,infoDealer
  },
  props: {
    value: {
      type: Object,
      required: true
    }
  },
  mounted() {
    console.log(this.value)
  },
  data() {
    return {
      labels: [
        { title: '基本信息', id: 'row-01' }, 
        { title: '活动列表', id: 'row-02' }, 
        { title: '物料列表', id: 'row-03' }, 
        { title: '经销商列表', id: 'row-04' }
        ]
    };
  },
  methods: {
    //保存
    saveDialog() {
      this.$emit('close', { visible: false });
    },
    //取消操作
    closeDialog() {
      this.$emit('close', { visible: false });
    }
  }
};
</script>
<style scoped>
.wrapper {
  height: calc(100vh - 110px);
}
</style>